<div>
  <div class="box-header with-border text-center">
    <h3 class="box-title">{{dialogTitle}}</h3>
  </div>
  <form class="form-horizontal">
    <div class="form-group">
      <label for="setTime_group" class="col-sm-2 control-label">选择分组</label>

      <div class="col-sm-10">
        <ui-select multiple close-on-select='true' ng-model="task.group" theme="bootstrap" sortable="true"  on-select='onSelect($item,$model)'>
          <ui-select-match placeholder="Select group...">
            {{$item.value.groupID
              }}
          </ui-select-match>
          <ui-select-choices  repeat="group.value as (key,group) in groups">
            <div ng-bind-html="group.value.groupID"></div>
          </ui-select-choices>
        </ui-select>
      </div>
    </div>

    <div class="form-group">
      <label for="priority" class="col-sm-2 control-label">任务优先级</label>
      <div class="col-sm-10">
        <select class="form-control" id="priority" ng-model="task.previous" ng-options="m.value as m.name for m in priorities">
          <option value="">-- 请选择 --</option>
        </select>
      </div>
    </div>
    <div class="form-group">
      <label for="setTime_month" class="col-sm-2 control-label">设置月份</label>


      <div class="col-sm-10">
        <ui-select multiple close-on-select='true'  ng-model="task.time.month" theme="bootstrap" sortable="true" on-select='onSelect($item,$model)' >
          <ui-select-match placeholder="Select month...">
            {{$item.value.name
              }}
          </ui-select-match>
          <ui-select-choices repeat="month.value.value as (key,month) in months">
            <div ng-bind-html="month.value.name"></div>
          </ui-select-choices>
        </ui-select>

      </div>

    </div>
    <div class="form-group">
      <label for="setTime_week" class="col-sm-2 control-label">设置周几</label>

      <div class="col-sm-10">
        <ui-select multiple close-on-select='true' ng-model="task.time.day" theme="bootstrap" sortable="true"  on-select='onSelect($item,$model)'>
          <ui-select-match placeholder="Select week...">
              {{$item.value.name}}
          </ui-select-match>
          <ui-select-choices repeat="week.value.value as (key,week) in weeks">
            <div ng-bind-html="week.value.name"></div>
          </ui-select-choices>
        </ui-select>
      </div>
    </div>
    <div class="form-group">
      <label for="setTime_day" class="col-sm-2 control-label">设置哪天</label>

      <div class="col-sm-10">
        <ui-select multiple close-on-select='true' ng-model="task.time.date" theme="bootstrap" sortable="true" on-select='onSelect($item,$model)' >
          <ui-select-match placeholder="Select date...">
            {{$item.value.name
              }}
          </ui-select-match>
          <ui-select-choices repeat="date.value.value as (key,date) in days">
            <div ng-bind-html="date.value.name"></div>
          </ui-select-choices>
        </ui-select>
      </div>
    </div>
    <div class="form-group">
      <label for="setTime_hour" class="col-sm-2 control-label">设置小时</label>

      <div class="col-sm-10">
        <ui-select multiple close-on-select='true' ng-model="task.time.hour" theme="bootstrap" sortable="true" on-select='onSelect($item,$model)' >
          <ui-select-match placeholder="Select hour...">
            {{$item.value.name
              }}
          </ui-select-match>
          <ui-select-choices repeat="hour.value.value as (key,hour) in hours">
            <div ng-bind-html="hour.value.name"></div>
          </ui-select-choices>
        </ui-select>
      </div>
    </div>
</form>
<div class=" text-center">
<button  ng-show="dialogType=='new_task'" type="submit" class="btn btn-info" ng-click="taskSetSave(task)" ng-disabled="(!task.group.length) || (!task.time) || (task.previous==null) || (!task.time.month.length) || ((!task.time.day.length) &&(!task.time.date.length)) ||(!task.time.hour.length)"> <i class='fa fa-save'></i>
  保存
</button>
<button class="btn btn-danger" ng-show="dialogType=='edit_task'" ng-click="deleteTask(task)">
  <i class="fa fa-trash"></i>删除
</button>
<button ng-show="dialogType=='edit_task'" class="btn btn-info" ng-click="saveTaskEdit()" ng-disabled="(!task.group.length) || (!task.time) || (task.previous==null) || (!task.time.month.length) || ((!task.time.day.length) &&(!task.time.date.length)) ||(!task.time.hour.length)">
  <i class='fa fa-save'></i>保存修改
</button>

</div>
</div>
